package com.example.goodsserver.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface GoodsDao {

    @Insert("insert into goods (id, name, price) values (#{id}, #{name}, #{price})")
    Integer insertGoods(@Param("id") Long id, @Param("name") String name, @Param("price") Integer price);

    @Select("select * from goods where id = #{id}")
    Map<String, Object> queryGoodsById(@Param("id") Long id);
}